#!/usr/bin/python
# -*- coding: utf-8 -*-

from django.contrib import admin

from easy_blog.models import Photoprint, Date_file, Love, Plan


class AuthorAdmin(admin.ModelAdmin):
    """docstring for AuthorAdmin"""
    list_display = ('name', 'email', 'website')
    search_fields = ('name',)  # 创建一个name的查询窗口　


class BlogAdmin(admin.ModelAdmin):
    """docstring for blogAdmin"""
    list_display = ('caption', 'id', 'author', 'publish_time')
    list_filter = ('publish_time',)  # 过滤器
    date_hierarchy = 'publish_time'  # 日期排列
    ordering = ('-publish_time',)  # 数据排序
    filter_horizontal = ('tags',)  # 隐藏字段　filter_vertical 水平与垂直
    # raw_id_fields = ('author',)  # 它是一个包含外键字段名称的元组，它包含的字段将被展现成`` 文本框`` ，而不再是`` 下拉框`` 。


class PhotoAdmin(admin.ModelAdmin):
    list_display = ('date_name', 'date_file', 'date_src')


# admin.site.register(Author, AuthorAdmin)
# admin.site.register(Blog, BlogAdmin)
# admin.site.register(Tag)
admin.site.register(Love)
# admin.site.register(Blog_user)
admin.site.register(Photoprint, PhotoAdmin)
admin.site.register(Date_file)
# admin.site.register(Comments)
admin.site.register(Plan)
